<script>
  var config = require("./config.js");

export default {
  created () {
    // 调用API从本地缓存中获取数据
    /*
     * 平台 api 差异的处理方式:  api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
     * 微信：mpvue === wx, mpvuePlatform === 'wx'
     * 头条：mpvue === tt, mpvuePlatform === 'tt'
     * 百度：mpvue === swan, mpvuePlatform === 'swan'
     * 支付宝(蚂蚁)：mpvue === my, mpvuePlatform === 'my'
     */

    let logs
    if (mpvuePlatform === 'my') {
      logs = mpvue.getStorageSync({key: 'logs'}).data || []
      logs.unshift(Date.now())
      mpvue.setStorageSync({
        key: 'logs',
        data: logs
      })
    } else {
      logs = mpvue.getStorageSync('logs') || []
      logs.unshift(Date.now())
      mpvue.setStorageSync('logs', logs)
    }
  },
  log () {
    console.log(`log at:${Date.now()}`)
  },
  onLaunch (){
    wx.setBackgroundFetchToken({
      token: 'zq12345'
    }),
      wx.getBackgroundFetchData({
        fetchType: 'pre',
        success(res) {
          console.log(res.fetchedData) // 缓存数据
          console.log(res.timeStamp) // 客户端拿到缓存数据的时间戳
          console.log(res.path) // 页面路径
          console.log(res.query) // query 参数
          console.log(res.scene) // 场景值
        },fail(res){
          console.log("失败")
          console.log(res)
        }
      })
  }
}
</script>

<style>
  @import '../static/iconfont/iconfont.css';
  .container {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 200rpx 0;
  box-sizing: border-box;
}
  .container2{
    width: 90%;
    margin: 0 auto;
    padding:10px 0 15px;
  }
  .fl{
    float: left;
  }
  .fr{
    float: right;
  }
/* this rule will be remove */
* {
  transition: width 2s;
  -moz-transition: width 2s;
  -webkit-transition: width 2s;
  -o-transition: width 2s;
}

  .pgbanner {
    height: 300rpx;
    overflow: hidden;
  }

  .pgbanner image {
    width: 100%;
    height: 100%;
    -webkit-animation: imageAnimation 3.5s linear 0s;
    animation: imageAnimation 3.5s linear 0s;
  }

  @-webkit-keyframes imageAnimation {
    0% {
      -webkit-transform: scale(1.8);
      -webkit-animation-timing-function: ease;
    }

    100% {
      -webkit-transform: scale(1);
    }
  }

  @keyframes imageAnimation {
    0% {
      -webkit-transform: scale(1.8);
      -webkit-animation-timing-function: ease;
    }

    100% {
      -webkit-transform: scale(1);
    }
  }

  .pgtitle{
    text-align: center;
  }

  .pgtitle .word{
    padding:0 5px;
    margin: 40px auto -20px;
  }
  .pgtitle .word .cn{
    position: relative;
    z-index:10;
    font-size: 16px;
    font-weight: bold;
    color:#005bac;
  }
  .pgtitle .word .en{
    font-family: Arial;
    color: #eceaea;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 24px;
    position: relative;
    z-index:-5;
    top: -30px;
  }
  .pgtitle .line{
    width: 30px;
    height: 2px;
    background: #d81e06;
    border-radius: 5px;
    margin: 0px auto 0;
  }
  .pgtitle2{
    margin: 15px auto 0;
    font-size: 16px;
    text-align: center;
    width: 95%;
    padding-left: 20px;
  }
  .clearfix:after{
    display: block;
    clear: both;
    content: "";
    visibility: hidden;
    height: 0;
  }
  .clearfix{
    zoom:1;
  }
  .content {
    width: 90%;
    color: #8d8d8d;
    margin-top: 30px;
    font-size: 12px;
    line-height: 25px;
    word-break:break-all!important;
    white-space: normal!important;
  }
</style>
